package com.zking.service.jch;



import com.zking.entity.Brand;
import com.zking.mapper.BrandMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public class BrandService  {

    @Autowired
    private BrandMapper brandMapper;

    public List<Brand> queryBrands(){
        return brandMapper.selectBrandAll();
    }

    public boolean addBrand(String brandName,String firstChar) {
        return brandMapper.addBrand(brandName,firstChar) > 0;
    }

    public boolean delBrand(int id) {
        return brandMapper.delBrand(id) > 0;
    }

    public Brand queryBrand(int id) {
        return  brandMapper.queryBrand(id);
    }

    public boolean updateBrand(int id, String brandName2, String firstChar2) {
        return brandMapper.updateBrand(id,brandName2,firstChar2) > 0;
    }
}

